﻿<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>编辑系统</title>
	<jsp:include page="/resources/inc/formHead.jsp" />
</head>
<body>
<form id="createForm" class="layui-form layui-form-pane" method="post">
	<div class="layui-form-item">
		<label class="layui-form-label" for="theme">主题</label>
		<div class="layui-input-block">
			<input id="theme" type="color" class="layui-input" name="theme" value="${system.theme}" lay-verify="required">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label" for="icon">图标</label>
		<div class="layui-input-block">
			<input id="icon" type="text" class="layui-input" name="icon" value="${system.icon}">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label" for="title">标题</label>
		<div class="layui-input-block">
			<input id="title" type="text" class="layui-input" name="title" value="${system.title}">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label" for="name">名称</label>
		<div class="layui-input-block">
			<input id="name" type="text" class="layui-input" name="name" value="${system.name}">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label" for="banner">背景图</label>
		<div class="layui-input-inline">
			<input id="banner" type="text" class="layui-input" name="banner" value="${system.banner}" readonly>
		</div>
		<div class="layui-input-inline">
			<div id="picker">上传背景图</div>
		</div>
	</div>
	<div class="layui-form-item layui-hide " id="uploadProgress">
		<div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="uploadProgress">
			<div class="layui-progress-bar layui-bg-green"  lay-percent="0%"></div>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label" for="description">描述</label>
		<div class="layui-input-block">
			<input id="description" type="text" class="layui-input" name="description" value="${system.description}">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label" for="basepath">根目录</label>
		<div class="layui-input-block">
			<input id="basepath" type="text" class="layui-input" name="basepath" value="${system.basepath}">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">状态</label>
		<div class="layui-input-block">
			<input type="radio" name="status" value="1" title="正常" <c:if test="${system.status==1}">checked</c:if>>
			<input type="radio" name="status" value="0" title="锁定" <c:if test="${system.status!=1}">checked</c:if>>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit="" lay-filter="sub">立即提交</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	</div>
</form>
<jsp:include page="/resources/inc/formFooter.jsp" />
<script src="${basePath}/resources/zheng-admin/js/upload-common.js"></script>
<script>
	$(function () {
		FormCommon.initForm({
			url: "${basePath}/manage/system/update/${system.systemId}"
		});

		var commonUpload = new CommonUpload("${ZHENG_OSS_FASTDFS}");
		commonUpload.setUserInfo({userId:"1"});
		commonUpload.setUploadSuccess(function (file,response) {
			$("#" + commonUpload.progressContainer).addClass("layui-hide");
			$('#banner').val(response.data.path).focus();
		});
		commonUpload.init();
	});

	function uploadComplete(file) {
		$('#banner').val(file.path).focus();
	}
</script>
</body>
</html>